<?php
namespace Core\Common\Helper;

/**
 * 全局类注册
 * Class Reg
 * @package App\Helper
 */
class Reg
{
    protected static $instances = [];

    public static function get($key)
    {
        if (isset(self::$instances[$key])) {
            return self::$instances[$key];
        }
        return null;
    }

    public static function set($key, $instance)
    {
        self::$instances[$key] = $instance;
    }
}